package com.bckj.fastboot.upms.api.util.dict.annotation;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.bckj.fastboot.upms.api.util.dict.DictSerializer;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotationsInside
@JsonSerialize(using = DictSerializer.class)
public @interface Dict {

    /** 字典类型 */
    String type();

    /**
     * 生成的字段名称 比如 @Dict(type="sys_user",genFieldName="createName") String createId;
     * 则生成的字段名称为createName
     * 默认是拼接Name
     */
    String genFieldName() default "";
}